package org.niugang.client;

import org.niugang.bean.JWT;
import org.niugang.client.hystrix.AuthServiceHystrix;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用microservice-base-oauth，获取token
 * Copyright: Copyright (c) 2018 863263957@qq.com
 * 
 * @ClassName: AuthServiceClient.java
 * @version: v1.0.0
 * @author: niugang
 * @date: 2018年11月18日 下午2:17:34
 */

@FeignClient(value = "microservice-base-oauth", fallback = AuthServiceHystrix.class)
public interface AuthServiceClient {

	@PostMapping(value = "/oauth/token")
	JWT getToken(@RequestParam("scope") String scope, @RequestParam("client_id") String clientId,
			@RequestParam("client_secret") String clientSecret, @RequestParam("grant_type") String type,
			@RequestParam("username") String username, @RequestParam("password") String password);
}
